zoukankan      html  css  js  c++  java
  • gcc -02引起内存溢出'unsigned i'应修订为'volatile unsigned i'

    2017-12-13 10:44:19
    gcc -02引起内存溢出'unsigned i'应修订为'volatile unsigned i'

    1.3.100 driver/char/random.c
    static inline void add_entropy_word(struct random_bucket *r,
                        const __u32 input)
    {
        volatile unsigned i; //old : unsigned i;
        __u32 w;

        w = (input << r->input_rotate) | (input >> (32 - r->input_rotate));
        i = r->add_ptr = (r->add_ptr - 1) & (POOLWORDS-1);
        if (i)
            r->input_rotate = (r->input_rotate + 7) & 31;
        else
            /*
             * At the beginning of the pool, add an extra 7 bits
             * rotation, so that successive passes spread the
             * input bits across the pool evenly.
             */
            r->input_rotate = (r->input_rotate + 14) & 31;

        /* XOR in the various taps */
        w ^= r->pool[(i+TAP1)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP2)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP3)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP4)&(POOLWORDS-1)];
        w ^= r->pool[(i+TAP5)&(POOLWORDS-1)];
        w ^= r->pool[i];
        /* Rotate w left 1 bit (stolen from SHA) and store */
        r->pool[i] = (w << 1) | (w >> 31);
    }

  • 相关阅读:
    mybatisplus学习
    JSON数组读取和保存
    XML文件读写示例
    JSON代码示例
    Delphi接口示例代码
    获得wav语音文件时长
    javaweb注册页面学习之路(三)
    javaweb注册页面学习之路(二)
    javaweb注册页面学习之路(一)
    Django 目录
  • 原文地址:https://www.cnblogs.com/mull/p/8031748.html
Copyright © 2011-2022 走看看